package com.ycg.vue.constant;

/**
 * @Description html邮件内容常量拼接类
 * @Author jink
 * @Date 2024/9/5
 */
public class EmailConstant {

    private static StringBuffer styleConstant = new StringBuffer();

    private static StringBuffer bodyConstant = new StringBuffer();

    private static final String HTML_HEADER = "<!DOCTYPE html>" +
            "<html lang=\"en\">" +
            "<head>" +
            "<meta charset=\"UTF-8\">" +
            "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" +
            "<title>FlexKinn</title>" +
            "<style>";

    private static final String HTML_FOOTER = "</body></html>";

    public static String text() {
        return HTML_HEADER +
                styleConstant.toString() +
                "</style></head><body>" +
                bodyConstant.toString() +
                HTML_FOOTER;
    }

    public static void body(StringBuffer body) {
        bodyConstant = body;
    }

    public static void body(String body) {
        bodyConstant = new StringBuffer(body);
    }

    public static void style(StringBuffer style) {
        styleConstant = style;
    }

    public static void style(String style) {
        styleConstant = new StringBuffer(style);
    }

    public static StringBuffer getStyle() {
        return styleConstant;
    }

    public static StringBuffer getBody() {
        return bodyConstant;
    }
}
